const express = require('express')
const router = express.Router()

const cate_handler=require('../router_handler/cate')
const {add_cate_schema,delete_cate_schema,update_cate_schema}=require('../schema/cate')
const expressJoi=require('@escook/express-joi')

//获取文章分类信息路由
router.get('/cates',cate_handler.getArticleCate)
//新增文章分类信息路由
router.post('/addcate',expressJoi(add_cate_schema),cate_handler.addArticleCate)
//删除文章的分类
router.get('/daletecate/:id',expressJoi(delete_cate_schema),cate_handler.deleteCateById)
//根据id获取文章分类的路由
router.get('/cates/:id',expressJoi(delete_cate_schema),cate_handler.getArtCateById)
//id更新文章分类数据
router.post('/updatecate',expressJoi(update_cate_schema),cate_handler.updateCateById)



module.exports = router

